<%--
  Created by lirong
  Date: 2017/6/10
  Time: 23:19
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="dao.ItemsDAO" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="entity.Items" %>
<html>
<head>
    <title>首页</title>
    <link rel="stylesheet" href="css/css.css">
</head>
<body>
<h1>商品展示</h1>
<hr>


<div class="main">
    <ul>
        <%
            ItemsDAO itemsDAO =new ItemsDAO();
            ArrayList<Items> list = itemsDAO.getAllItems();
            if (list!=null && list.size()>0){
                for (int i = 0; i < list.size(); i++) {
                    Items items =list.get(i);
             //       System.out.println("ID:"+items.getId()+"--NAME:"+items.getName()+"CITY:"+items.getCity()+"PRICE:"+items.getPrice()+"NUMBER:"+items.getNumber()+"PICTURE:"+items.getPicture());
        %>

        <li>
            <a href="details.jsp?id=<%=items.getId()%>">
                <div class="img"><img src="images/<%=items.getPicture()%>" width="250" height="200" alt="<%=items.getName()%>"></div>
                <div class="price">价格：<%=items.getPrice()%></div>
                <div class="name">名称：<%=items.getName()%></div>
                <div class="city">所在城市:<%=items.getCity()%></div>
            </a>
        </li>

        <%
            }
            }

        %>
    </ul>

</div>




















</body>
</html>
